<div class="slide-dialog-header">
	<h2>{{title}}</h2>
	<div class="slide-dialog-toolbar">
		<ul>
			<li><span class="ui-btn slide-dialog-close" ng-click="close(false)"><i class="fa fa-remove"></i></span></li>
		</ul>
	</div>
</div>
<div class="slide-dialog-body x-slide-dialog-body">
	<form name="form" novalidate="novalidate" ng-submit="submit(form.$valid);">
		<div class="x-data-panel-fixed">
			<div class="x-data-panel-body">
				<div class="data-step">
					<div class="step-header">
						<div class="step-header-view">
							<span class="step-node" ng-repeat="state in states track by $index" ng-class="{'step-hover': $index <= index}" ng-click="step($index)">{{state.title}}</span>
						</div>
					</div>
					<div class="step-body">
						<div class="x-group">
							<div class="x-group-header">
								<h3>数据任务名称</h3>
							</div>
							<div class="x-group-body">
								<div class="data-form">
									<dl>
										<input type="text" ng-model="data.name" name="name" required class="x-ipt" placeholder="请输入任务名称" style="width:42%;" />
										<span class="x-error" ng-if="interacted(form.name)" ng-messages="form.name.$error"><span ng-message="required">名称不能为空</span></span>
									</dl>
								</div>
							</div>
						</div>
						<div class="x-group">
							<div class="x-group-header">
								<h3>选择一个数据源</h3>
							</div>
							<div class="x-group-body">
								<!-- <div class="x-data-types">
									<span class="x-data-add"><i class="fa fa-plus-circle"></i> 新建数据源</span>
									<span class="x-data-type">数据源一</span>
									<span class="x-data-type">这是传说中的测试数据源</span>
									<span class="x-data-type active">数据源三</span>
								</div> -->
								<div class="x-data-types">
									<input type="hidden" name="source" ng-model="data.source.id" required />
									<span class="x-data-add" ng-click="selectSoruce()"><i class="fa fa-plus-circle"></i> 选择数据源</span><span class="x-error" ng-if="interacted(form.source)" ng-messages="form.source.$error"><span ng-message="required">名称不能为空</span></span>
									<span class="x-data-type active" ng-if="data.source">{{data.source.name}}</span>
								</div>
							</div>
						</div>
						<div class="x-group">
							<div class="x-group-header">
								<h3>选择一个数据目的地</h3>
							</div>
							<div class="x-group-body">
								<!-- <div class="x-data-types">
									<span class="x-data-add"><i class="fa fa-plus-circle"></i> 新建数据目的地</span>
									<span class="x-data-type">数据源一</span>
									<span class="x-data-type">这是传说中的测试数据源</span>
									<span class="x-data-type active">数据源三</span>
								</div> -->
								<div class="x-data-types">
									<span class="x-data-add" ng-click="selectSoruce()"><i class="fa fa-plus-circle"></i> 选择数据目的地</span>
									<span class="x-data-type active" ng-if="data.target">{{data.target.name}}</span>
								</div>
							</div>
						</div>
						<div class="x-group">
							<div class="x-group-header">
								<h3>任务设置</h3>
							</div>
							<div class="x-group-body">
								<div class="data-form">
									<table cellspacing="0" cellpadding="0">
										<colgroup>
											<col width="100" />
										</colgroup>
										<tbody>
											<tr>
												<td>读取方式：</td>
												<td><label class="radio-group"><input type="radio" name="type" ng-model="data.type" />全量</label><label class="radio-group"><input type="radio" name="type" ng-model="data.type" />增量</label></td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
						</div>
						<div class="x-group">
							<div class="x-group-header">
								<h3>定时设置</h3>
							</div>
							<div class="x-group-body">
								<div class="data-form">
									<table cellspacing="0" cellpadding="0">
										<colgroup>
											<col width="100" />
										</colgroup>
										<tbody>
											<tr>
												<td>任务类型：</td>
												<td><label class="radio-group"><input type="radio" name="type" class="x-radio" ng-model="data.task.type" ng-value="1" ng-init="data.task.type=data.task.type||'1'">实时任务</label><label class="radio-group"><input type="radio" name="type" class="x-radio" ng-model="data.task.type" ng-value="2">定时任务</label><label class="radio-group"><input type="radio" name="type" class="x-radio" ng-model="data.task.type" ng-value="3">执行一次</label></td>
											</tr>
											<tr>
												<td>任务频率：</td>
												<td>
													<div class="form-field-auto">
														<p>
															<label for="">间隔：</label>&nbsp;&nbsp;<input type="number" ng-model="data.task.interval" class="x-ipt" value="1" />&nbsp;&nbsp;<select ng-model="data.task.cycle" ng-init="data.task.cycle=data.task.cycle||'day'"><option value="day">天</option><option value="week">周</option><option value="month">月</option></select>
														</p>
														<p>
															<label class="radio-group"><input type="radio" ng-model="data.task.model" ng-value="1" />执行一次时间为：</label><input type="text" class="x-ipt" value="hh:mm:ss" ng-disabled="data.task.model=='2'" />
														</p>
														<p>
															<label class="radio-group"><input type="radio" ng-model="data.task.model" ng-value="2" />执行间隔：</label><input type="number" class="x-ipt" ng-value="1" ng-disabled="data.task.model=='1'" />&nbsp;&nbsp;<select name="" id="" ng-disabled="data.task.model=='1'"><option value="">小时</option><option value="">分</option><option value="">秒</option></select>&nbsp;&nbsp;<label>开始时间：<input type="text" ng-model="data.task.startTime" class="x-ipt x-ipt-date" placeholder="开始时间" datetime /></label>&nbsp;&nbsp;<label>结束时间：<input type="text" ng-model="data.task.endTime" class="x-ipt x-ipt-date" placeholder="开始时间" datetime /></label>
														</p>
													</div>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
						</div>
						<div class="x-group">
							<div class="x-group-header">
								<h3>配置规则</h3>
							</div>
							<div class="x-group-body">
								<div class="data-form">
									<table cellspacing="0" cellpadding="0">
										<colgroup>
											<col width="100" />
										</colgroup>
										<tbody>
											<tr>
												<td class="x-control" style="vertical-align:middle;">源列表：</td>
												<td>
													<div class="x-data-types">
														<input type="hidden" name="tables" ng-model="data.tables" ng-required="checkTables()" />
														<button type="button" class="x-data-add" ng-click="selectTable()" ng-disabled="!data.source.id"><i class="fa fa-plus-circle"></i> 选择表</button>
														<span class="x-error" ng-if="interacted(form.tables)" ng-messages="form.tables.$error"><span ng-message="required">至少选择一张表</span></span>
														<span class="x-data-type" ng-repeat="table in data.tables track by table.id" ng-class="{'active': $index == vm.tableNumber}" ng-click="checkTable($index)">{{table.name}}</span>
													</div>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
								<div class="data-form">
									<table cellspacing="0" cellpadding="0">
										<colgroup>
											<col width="100" />
										</colgroup>
										<tbody>
											<tr>
												<td class="x-control" style="vertical-align:middle;">目的表：</td>
												<td style="vertical-align:middle;">
													<label class="radio-group"><input type="radio" name="tableType" ng-model="data.tables[vm.tableNumber].type" value="1" ng-disabled="checkTables()" />同源</label><label class="radio-group"><input type="radio" name="tableType" ng-model="data.tables[vm.tableNumber].type" value="2" ng-disabled="checkTables()" />中心库选取</label>
													<span ng-if="data.tables[vm.tableNumber].type==1">
														<input type="text" ng-model="data.tables[vm.tableNumber].tableName" name="tableName" required class="x-ipt" placeholder="请输入目标表名称" style="width:200px;" ng-disabled="checkTables()" /><span class="x-error" ng-if="interacted(form.tableName)" ng-messages="form.tableName.$error"><span ng-message="required">表名称不能为空</span></span>
													</span>
													<span class="x-data-types" ng-if="data.tables[vm.tableNumber].type==2">
														<input type="hidden" name="targetTable" ng-model="data.tables[vm.tableNumber].targetId" required />
														<button type="button" class="x-data-add" ng-click="selectLocalTable()" ng-disabled="checkTables()"><i class="fa fa-plus-circle"></i> 选择表</button>
														<span class="x-error" ng-if="interacted(form.targetTable)" ng-messages="form.targetTable.$error"><span ng-message="required">请选择一张表</span></span>
														<span class="x-data-type active" ng-if="data.tables[vm.tableNumber].targetName">{{data.tables[vm.tableNumber].targetName}}</span>
													</span>
												</td>
											</tr>
											<tr>
												<td></td>
												<td><div grid-view="gridOptions"></div></td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="x-data-panel-footer">
				<button class="dialog-button cancel-button" type="button" ng-click="close(false)">取消</button><button class="dialog-button" type="submit" ng-disabled="formDisabled">提交任务</button>
			</div>
		</div>
	</form>
</div>